import { useNavigate } from 'react-router-dom';

type Props = {
  pageName: string
}

function usePageAuth() {
  const navigate = useNavigate();

  // 验证是否有权限的逻辑行为
  const isAuthenticated = () => {
    return true
  };

  const handleUnauthorized = () => {
    navigate('/login');
  };

  return { isAuthenticated, handleUnauthorized };
}

export default usePageAuth;